Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow API token to be retrieved from environment variable #24 #25

Merged
merged 1 commit into from
Oct 30, 2020

Conversation

pdurbin
Copy link
Member

@pdurbin pdurbin commented Oct 29, 2020

Closes #24 - Allow API token to be retrieved from an environment variable

I'm aware that there's a similar solution in pull request #14

I'm also aware that here the dvconfig.py file is edited directly: https://github.com/GlobalDataverseCommunityConsortium/dataverse-ansible/blob/56ae75de0a796e515200d6830115f60e6ce3fd5e/tasks/sampledata.yml#L59

This is a small chunk and makes things easier for me.

@@ -33,6 +33,8 @@ Copy `dvconfig.py.sample` to `dvconfig.py` (see the `cp` command below) and add
cp dvconfig.py.sample dvconfig.py
vi dvconfig.py

Note that the environment variable `$API_TOKEN` will override `api_token` in `dvconfig.py`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only question here is which token should take precedence, the environment variable or the one in dvconfig.py? (I have not looked at this code very deeply overall, so not necessarily advocating for the switch)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I searched online and it seems standard for environment variable to take precedence.

@kcondon kcondon self-assigned this Oct 30, 2020
@kcondon kcondon merged commit 8d705f0 into master Oct 30, 2020
@kcondon kcondon deleted the 24-api-token-env-var branch October 30, 2020 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow API token to be retrieved from an environment variable
3 participants